/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Controllers;

import Entities.Continent;
import Entities.Land;
import Interfaces.AdminInterface;
import Interfaces.ZoekenInterface;
import java.io.Serializable;
import java.util.List;
import javax.enterprise.context.RequestScoped;
import javax.inject.Inject;
import javax.inject.Named;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

/**
 *
 * @author Dries
 */
@Named
@RequestScoped
public class ControllerAdmin implements Serializable {

    private Land land;
    private int continentId;
    
    @Inject
     AdminInterface adminInterface;
    
    public ControllerAdmin() {
        land = new Land();
    }
   
    public List<Continent> getAllContinent() {
        return adminInterface.continenten();
    }
    
    public int getContinentId() {
        return continentId;
    }

    public void setContinentId(int continentId) {
        this.continentId = continentId;
    }
    
    public Land getLand() {
        return land;
    }

    public void setLand(Land land) {
        this.land = land;
    }
    
    public String toevoegenLand() {
         
         adminInterface.insertLand(land, this.getContinentId());
         return "index.xhtml";
    }
    
}
